package com.tyut.service.Impl;

import com.tyut.mapper.StudentMapper;
import com.tyut.pojo.Student;
import com.tyut.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class StudentServiceImpl implements StudentService {

    @Autowired
    private StudentMapper studentMapper;

    @Override
    public int insertStudent(Student student) {
        int i = studentMapper.insertStudent(student);
        return i;
    }

    @Override
    public Student findStudentById(String id) {
        Student student = studentMapper.findStudentById(id);
        return student;
    }

    @Override
    public List<Student> findStudentByName(String name) {
        List<Student> student = studentMapper.findStudentByName(name);
        return student;
    }

    @Override
    public List<Student> findStudentAll() {
        List<Student> studentAll = studentMapper.findStudentAll();
        return studentAll;
    }

    @Override
    public int updateStudent(Student student) {
        int i = studentMapper.updateStudent(student);
        return i;
    }


}
